<?php
/**
 * IndexController - The default controller class
 *
 * @author
 * @version
 */
require_once 'Zend/Controller/Action.php';
class CouponcodeController extends App_Zend_Controller_Action_Shop
{
	public function init()
	{
		$this->getHelper('layout')->setLayout('facebooklayout');
    	$this->view->styleName = 'click-like2';
	}
	
    public function clicklikebeforeAction()
    {
    	
    }

    
    public function clicklikeafterAction()
    {
/*
    	$this->getHelper('viewRenderer')->setNoRender();
		$this->getHelper('layout')->disableLayout();
    	for($k=0;$k<200;$k++){
	    	$couponcode = new CCouponCode();
			$KEYWORD = 'abcdefghijkmnpqrstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ0123456789';
			$postr = str_shuffle($KEYWORD);
			$pos = mt_rand(0,strlen($postr) - 20);
			$code = '';
			while (empty($code))
	        {
	            $code = substr($postr,$pos,mt_rand(15,20));
	            if ($couponcode->isexist($code))
	            {
	                $code = '';
	            }
	        }
	    	
	    	$thisArray=$this->_request->getParams();
	    	
			$filters = array(
	    		'*'   => 'StringTrim'
			);
	
			$validators = array(
			);
			    	
			$itemarray = array(
				'code'		=>	$code,
				'from'		=>	'facebook',
				'score'		=>  1500,
				'createtime'=>	time(),
				'endtime'	=>  time()+3600*24*30
			);
			$couponcode->createcode($itemarray);
	    	echo $code.'<br />';
    	}*/
    }

}
